package by.amakarevich.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.amakarevich.datamodel.DeliveryAddress;
import by.amakarevich.datamodel.Booking;
import by.amakarevich.datamodel.UserAccount;

public interface DeliveryAddressService {
	@Transactional
	void addNewDeliveryAddress(DeliveryAddress deliveryAddress, UserAccount userAccount,Booking booking);
	
	@Transactional
	DeliveryAddress get(Long id);
	
	@Transactional
	void updateDeliveryAddress(DeliveryAddress deliveryAddress);
	
	@Transactional
    void deleteAll();

    List<DeliveryAddress> getAllDeliveryAddressByUser(SingularAttribute<DeliveryAddress, ?> attr, boolean ascending, int startRecord, int pageSize);
    
    @Transactional
    void deleteDeliveryAddress(Long id);
    
    DeliveryAddress getByBooking(Booking booking);
}
